#include <cstdio>
#include <algorithm>
using namespace std;

#define INF 0x7F7F7F7F

int M, K;
int A[505], S;

bool cal(int x) {
    int cnt = 0;
    int sum = 0;
    for (int i=0; i<M; i++) {
        if (A[i] > x)
            return false;
        sum += A[i];
        if (sum > x) {
            cnt++;
            sum = A[i];
            if (cnt > K)
                return false;
        }
    }
    cnt++;
    if (cnt > K)
        return false;
    return true;
}

long long solve(long long n, long long p) {
    if (n == 0)
        return p;
    if (cal(n)) {
        return solve(n/2, n);
    } else {
        if (n == p-1)
            return p;
        return solve((n+p)/2, p);
    }
}

int main() {
    int N;
    scanf("%d", &N);
    while (N--) {
        scanf("%d%d", &M, &K);
        S = INF;
        for (int i=0; i<M; i++) {
            scanf("%d", &A[i]);
            S += A[i];
        }
        long long result = solve(S/2, S);
        //printf("%lld\n", result);
        int cnt = 0;
        long long sum = 0;
        bool flag[505] = {false};
        for (int i=M-1; i>=0; i--) {
            if (i+1 == K-cnt-1) {
                cnt++;
                flag[i] = true;
                continue;
            }
            sum += A[i];
            if (sum > result) {
                sum = A[i];
                flag[i] = true;
                cnt++;
            }
        }
        bool first = true;
        for (int i=0; i<M; i++) {
            if (first) first = false;
            else printf(" ");
            printf("%d", A[i]);
            if (flag[i])
                printf(" /");
        }
        printf("\n");
    }
    return 0;
}